<template>
	<view style="height: 100%">
		<!-- 	<button style="position: fixed;width: 80rpx;height: 80rpx;bottom: 200rpx;right: 30rpx;background-color: #1050c7;z-index: 999;border-radius: 50%;display: flex;align-items: center;justify-content: center;" open-type="contact">
			<image src="@/static/icon/chatIcon.png" mode="widthFix" style="width: 40rpx;height: auto;"></image>
		</button> -->
		<!-- 		<image src="https://cdn.xtwaixie.com/uploads/20240415/1713170494661ce83e71ae5.png" mode="aspectFit"
			style="position: fixed;z-index: 9999;right: 24rpx;width: 88rpx;height: 88rpx;bottom: 170rpx;"
			@tap="showWechat = true"></image> -->
		<view :style="'padding-top:' + (navTop * 2 - 6) + 'rpx;'" class="pots">
			<!-- <view class="back-img" @tap="showPopups">
				<view class="df ac">
					<image class="img16" src="https://wx.xtwaixie.com/img/add1.png" />
					<p class="f14 c28 f600 ml8">{{ top_area[1] }}</p>
				</view>
			</view> -->
			<view class="top-title">接单大厅</view>
		</view>
		<view style='position: relative;z-index: 9;'>
			<add-tips :text="'下次找订单更方便'"/>
		</view>
		<view :style="'padding-top:' + (navTop * 2 - 6) + 'rpx;height:90rpx;'"></view>
		<view class="pd015">
			<!-- 轮播 -->
			<swiper class="demand-swiper mt12" :indicator-dots="true" :circular="true"
				indicator-color="rgba(255,255,255,.3)" indicator-active-color="#fff" :autoplay="true" interval="5000">
				<block v-for="(item, index) in demand_banner" :key="index">
					<swiper-item>
						<image mode="aspectFill" class="demand-swiper br10" referrerPolicy='no-referrer'
							:src="item.thumb" @tap="onSwiper" :data-item="item" />
					</swiper-item>
				</block>
			</swiper>
		</view>
		<view class="post" :style="'top:' + (navTop * 2 + 84) + 'rpx;z-index: 100;'">
			<view class="mt10">
				<van-search :value="searchValue" placeholder="关键字/产品/材料..." shape="round" @change="changVal"
					@search="goSearch" />
			</view>
			<!-- 顶部筛选 -->
			<view>
				<ul class="df ac bgcf bbf1">
					<block v-for="(item, index) in tab_list" :key="index">
						<li class="df ac jc h44 w50" @tap.native="ontabSel($event, { i: index })" :data-i="index"
							style="width: 250rpx;">
							<P :class="'f14 ' + (item.show || item.is_select ? 'c10' : 'c6b')" class="tabListName">
								{{ item.name }}
							</P>
							<!-- <image class="down ml8" referrerPolicy='no-referrer'
								:src="item.show ? 'https://wx.xtwaixie.com/img/down1.png' : 'https://wx.xtwaixie.com/img/down.png'" /> -->
							<van-icon
								:custom-style="item.show ? 'transform:rotate(-90deg);margin-left:10rpx;transition: all 0.2s;': 'transform:rotate(90deg);margin-left:10rpx;transition: all 0.2s;'"
								name="play" size="24rpx" :color="item.show || item.is_select ? '#1050c7' : '#6b758c'" />
						</li>
					</block>
				</ul>
			</view>
			<view class="" style="width: 100vw;box-sizing: border-box;overflow: hidden;background-color: #fff;">
				<view class="label_box mt10" v-if="label_list && label_list.length !== 0">
					<view class="label_list df ac" :style="'width:' + 180 * label_list.length + 'rpx'">
						<view
							:class="item.is_select ? 'label_list_item_active label_list_item f14' :'label_list_item f14'"
							v-for="(item,index) in label_list" :key="index" @click="changeLab(index)">
							{{item.name}}

							<view class="hy-sel" v-if="item.is_select">
								<image style="width:100%;height: 100%;" src="@https://wx.xtwaixie.com/img/hy-sel.png"
									mode="widthFix">
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>

		<popup :type="0" :show="true" :user="user_info" @change="getUserInfo"></popup>
		<!-- <view class="gz-box df ac sb">
			<p class="f12 c10">免费开通新订单提醒功能</p>
			<button @tap="goWeb" style="width: 110rpx !important;background-color: #01C060;">去开通</button>
		</view> -->
		<!-- 列表 -->
		<ul class="db pd015" v-if="list.length != 0">
			<view class="bbf1" style="padding-bottom: 20rpx;" v-for="(item, index) in list" :key="index">
				<view @tap="demandDetails(item.id,item.view_type)" class=" xpg df pd150" style="align-items: center;"
					:style="{padding:item.is_quotation !== 0 ? '11.33rpx 0' : '30rpx 0 12rpx'}">
					<view class="f1 mr10" :class="{gray:item.is_end == 1 || item.is_deal == 1}">
						<view class="">
							<!-- <p class='tag mr8' wx:if='{{item.machining_name}}'>{{item.machining_name}}</p> -->
							<P :class="'f14  f600 ' + (item.is_end == 1 || item.is_deal == 1 ? 'c3c' : 'c28')">
								{{ item.spare_parts_name }}
							</P>
						</view>
						<view class="df ac mt8">
							<image class="img12" src="https://wx.xtwaixie.com/img/dz2.png" />
							<span
								:class="'f12 c6b ml4 ' + (item.is_end == 1 || item.is_deal == 1 ? 'c3c' : 'c28')">{{ item.province }}
								{{ item.city }}</span>
							<p class="line"></p>
							<!-- <view v-if="item.count != 0" :class="'c10 f500 f12 ' + (item.is_end == 1 || item.is_deal == 1 ? 'c3c' : 'c28')">
								{{ item.parts_count >= 2 ? '共' + item.parts_count + '款' : item.parts_piece ? '共' + item.count + item.parts_piece : '' }}
							</view> -->
							<!-- <span class='c10 f500 f12 {{item.is_end==1?"c28":"c28"}}'>共{{item.count}}件</span> -->
							<view :class="'c10 f500 f12 ' + (item.is_end == 1 || item.is_deal == 1 ? 'c3c' : 'c28')">
								<!-- {{ item.parts_count >= 2 ? '共' + item.parts_count + '款' : item.parts_piece ? (item.count == 0 ? '' : '共' + item.count) + item.parts_piece : '' }} -->
								<!-- {{  item.parts_piece ? (item.count == 0 ? '' : '共' + item.count) + item.parts_piece : '' }} -->
								{{item.count == 0?'':'共'+item.count+item.parts_piece}}
							</view>
							
							<!-- v-if="is_info" -->
							<view  class="df ac">
								<p class="tag tag1 ml4" v-if="grade > 0 && item.view_type > 0">
									<text v-if='item.view_type == 1'>免费</text>
									<text v-if='item.view_type == 2'>VIP</text>
									<text v-if='item.view_type == 3'>至尊</text>
								</p>
								<!-- {{item}} -->
							</view>
							
							<!-- <p class="tag tag1 ml4">{{ item.view_integral }}积分</p> -->
						</view>
						<view class="df ac mt10">
							<p :class="'f12 c9d ' + (item.is_end == 1 || item.is_deal == 1 ? 'c3c' : 'c28')">
								{{ item.company }}
							</p>
							<p :class="'f12 c9d ml10 ' + (item.is_end == 1 || item.is_deal == 1 ? 'c3c' : 'c28')">
								报价截止：{{ item.end_at }}</p>
						</view>
					</view>
					<view class="img72 pr" hover-class="none" :hover-stop-propagation="false" style="height: auto;">
						<!-- <view class="quotationNum" v-if="item.is_quotation !== 0"
							:class="{gray:item.is_end == 1 || item.is_deal == 1}"> 已报价:{{item.quotation_count}}
						</view> -->
						<image class="img72" style="" referrerPolicy='no-referrer'
							:src="getImgSrc(item.redrawing) ? getImgSrc(item.redrawing) : ''"
							style="vertical-align: bottom;" :class="{gray:item.is_end == 1 || item.is_deal == 1}" />
						<p class="bj" v-if="item.is_deal == 1" :class="{gray:item.is_end == 1 || item.is_deal == 1}">已完成
						</p>
						<p class="bj" v-else-if="item.is_end == 2">报价中</p>
						<p class="bj" v-else :class="{gray:item.is_end == 1 || item.is_deal == 1}">已完成</p>
						<image class="yjs" mode="widthFix"
							src="https://cdn.xtwaixie.com/uploads/20240415/1713167495661cdc8768cb9.png"
							style="left: -100%;width: 140rpx;top: 50%;transform: translateY(-50%);filter: none !important;"
							v-if="item.is_deal == 1 || item.is_end == 1"></image>
					</view>
				</view>
				<view class="df sb ac" style="align-items: flex-start;">
					<view :class="{gray:item.is_end == 1 || item.is_deal == 1}">
						<view class="df ac mb5 fw" v-if="item.custom_tag.length !== 0">
							<view class="f11 mr5 c10 mb5"
								style="padding:5rpx 6rpx;border:1px solid rgba(64,115,210,0.6);border-radius:8rpx;"
								v-for="(item2,index2) in item.custom_tag" :key="index2">
								{{item2}}
							</view>
						</view>
						<view class=" f12 df ac" v-if="item.parts_remarks && item.parts_remarks != ''">
							<view>"</view>
							<view class="quotation_text"
								:style="item.is_end == 1 || item.is_deal == 1 ? 'color:#8D8D8D;' : ''">
								{{ item.parts_remarks }}
							</view>
							<view>"</view>
						</view>
					</view>
					<view class="">
						<view v-if="item.quotation_count >= 0 && item.quotation_count <= 5">
							<view class="is_quotation greenStyle f12" v-if="item.is_quotation !== 0"
								:class="{gray:item.is_end == 1 || item.is_deal == 1}">
								已报价:{{item.quotation_count}}
							</view>
						</view>
						<view v-else-if="item.quotation_count >= 6 && item.quotation_count <= 10">
							<view class="is_quotation orangeStyle f12" v-if="item.is_quotation !== 0"
								:class="{gray:item.is_end == 1 || item.is_deal == 1}">
								已报价:{{item.quotation_count}}
							</view>
						</view>
						<view v-else>
							<view class="is_quotation redStyle f12" v-if="item.is_quotation !== 0"
								:class="{gray:item.is_end == 1 || item.is_deal == 1}">
								已报价:{{item.quotation_count}}
							</view>
						</view>
					<!-- 	<view class="is_quotation f12" v-if="item.is_quotation !== 0"
						      :class="{gray: item.is_end == 1 || item.is_deal == 1, [judgeColor(item.quotation_count)]: true}">
						    已报价:{{ item.quotation_count }}
						</view> -->
					</view>
				</view>
			</view>
		</ul>
		<p class="db tc mt40 f14 c9" v-else>没有找到任何内容~</p>
		<view class="Not satisfied mt20" v-if="is_lookAfter">
			<view class="f14" style="color:#1050c7;text-align:center;">
				{{ look_text }}
			</view>
			<view class="free_join_in"
				@click="goPages( btn_text === '登录' ? '/pages/login/login' : '/pages/settled/setPage')">
				{{ btn_text }}
			</view>
		</view>
		<!-- 地址 -->
		<van-popup :show="show" round @close="onClose" position="bottom">
			<van-area :area-list="areaList" @confirm="confirm" @cancel="onClose" columns-num="2" />
		</van-popup>
		<!-- 工艺 -->
		<van-popup :show="tab_list[0].show" @close="onClose" position="top">
			<view class="" :style="'padding-top:' + (navTop * 2 + 90) + 'rpx;'">
				<ul class="df ac bgcf bbf1">
					<block v-for="(item, index) in tab_list" :key="index">
						<li class="df ac jc h44 w50" @tap.native="ontabSel($event, { i: index })" :data-i="index"
							style="width: 250rpx;">
							<P :class="'f14 ' + (item.show ? 'c10' : 'c6b')" class="tabListName">{{ item.name }}</P>
							<van-icon
								:custom-style="item.show ? 'transform:rotate(-90deg);margin-left:10rpx;transition: all 0.2s;': 'transform:rotate(90deg);margin-left:10rpx;transition: all 0.2s;'"
								name="play" size="24rpx" :color="item.show ? '#1050c7' : '#6b758c'" />
						</li>
					</block>
				</ul>
				<view class="h360" style="display: flex;">
					<scroll-view class="h360 bgcf7" :scroll-y="true" style="width: 250rpx;">
						<ul class="db">
							<block v-for="(item, index) in info.machiningre" :key="index">
								<li class="pd015 h48 df ac sb" :class="{bgcf:tabChoosed == index}"
									@tap.native="changeTab(index,item.id,item.name)">
									<p :class="'f14 c28 ' + (tabChoosed == index ? 'c10' : '')">{{ item.name }}
									</p>
								</li>
							</block>
						</ul>
					</scroll-view>
					<!-- <scroll-view class="h360" :scroll-y="true" style="width: 500rpx;">
						<ul class="db">
							<block v-for="(item, index) in info.machiningre[tabChoosed].children" :key="index">
								<li class="pd015 h48 df ac sb"
									@tap.native="onTab($event, { id: item.id, name: item.name })" :data-id="item.id"
									:data-name="item.name">
									<p :class="'f14 c28 ' + (tab_list[0].act === item.id ? 'c10' : '')">{{ item.name }}
									</p>
									<image class="sel" src="https://wx.xtwaixie.com/img/sel.png" v-if="tab_list[0].act === item.id" />
								</li>
							</block>
						</ul>
					</scroll-view> -->
				</view>
			</view>
		</van-popup>
		<!-- 原材料 -->
		<!-- <van-popup show="{{ tab_list[1].show }}" bind:close="onClose" position="top">
	<ul class='df ac bgcf bbf1'>
		<block wx:for
		tab_list}}" wx:key='index'>
			<li class='df ac jc h44 w33' bindtap='ontabSel' data-i='{{index}}'>
				<P class='f14 {{item.show?"c10":"c6b"}}'>{{item.name}}</P>
				<image class="down ml8" src="{{item.show?'../../img/down1.png':'../../img/down.png'}}" />
			</li>
		</block>
	</ul>
	<scroll-view class="h360" scroll-y="true">
		<ul class='db'>
			<block wx:for="{{info.materia}}" wx:key='index'>
				<li class='pd015 h48 df ac sb' bindtap='onTab' data-id='{{item.id}}' data-name='{{item.name}}'>
					<p class='f14 c28 {{tab_list[1].act === item.id?"c10":""}}'>{{item.name}}</p>
					<image class="sel" src="../../img/sel.png" wx:if='{{tab_list[1].act === item.id}}' />
				</li>
			</block>
		</ul>
	</scroll-view>
</van-popup> -->
		<!-- 地区 -->
		<van-popup :show="tab_list[1].show" @close="onClose" position="top">
			<view class="" :style="'padding-top:' + (navTop * 2 + 90) + 'rpx;'">
				<ul class="df ac bgcf bbf1">
					<block v-for="(item, index) in tab_list" :key="index">
						<li class="df ac jc h44 w50" @tap.native="ontabSel($event, { i: index })" :data-i="index"
							style="width: 250rpx;">
							<P :class="'f14 ' + (item.show ? 'c10' : 'c6b')" class="tabListName">{{ item.name }}</P>
							<van-icon
								:custom-style="item.show ? 'transform:rotate(-90deg);margin-left:10rpx;transition: all 0.2s;': 'transform:rotate(90deg);margin-left:10rpx;transition: all 0.2s;'"
								name="play" size="24rpx" :color="item.show ? '#1050c7' : '#6b758c'" />
						</li>
					</block>
				</ul>
				<view class="df">
					<scroll-view class="h360 w125 bgcf7" :scroll-y="true">
						<ul class="db">
							<block v-for="(item, index) in province_list" :key="index">
								<li :class="'tab-left ' + (region[0].act === item.region_id ? 'bgcf' : '')"
									@tap.native="onRegion($event, { name: item.region_name, id: item.region_id, type: 0 })"
									:data-name="item.region_name" :data-id="item.region_id" :data-type="0">
									<p :class="'f14 c28 ovh w110 ' + (region[0].act === item.region_id ? 'c10' : '')">
										{{ item.region_name }}
									</p>
								</li>
							</block>
						</ul>
					</scroll-view>
					<scroll-view class="h360 f1" :scroll-y="true">
						<ul class="db">
							<block v-for="(item, index) in city_list" :key="index">
								<li class="pd015 h48 df ac sb"
									@tap.native="onRegion($event, { name: item.region_name, id: item.region_id, type: 1 })"
									:data-name="item.region_name" :data-id="item.region_id" :data-type="1">
									<p :class="'f14 c28 ' + (region[1].act === item.region_id ? 'c10' : '')">
										{{ item.region_name }}
									</p>
									<image class="sel" src="https://wx.xtwaixie.com/img/sel.png"
										v-if="region[1].act === item.region_id" />
								</li>
							</block>
						</ul>
					</scroll-view>
				</view>
			</view>
		</van-popup>
		<!-- 日期 -->
		<!-- <van-popup show="{{ tab_list[2].show }}" bind:close="onClose" position="top">
  <ul class='df ac bgcf bbf1'>
    <block wx:for="{{tab_list}}" wx:key='index'>
      <li class='df ac jc h44 w33' bindtap='ontabSel' data-i='{{index}}'>
        <P class='f14 {{item.show?"c10":"c6b"}}'>{{item.name}}</P>
        <image class="down ml8" src="{{item.show?'../../img/down1.png':'../../img/down.png'}}" />
      </li>
    </block>
  </ul>
  <van-datetime-picker type="date" value="{{ currentDate }}" bind:cancel="onClose" bind:confirm="onConfirm" min-date="{{ minDate }}" formatter="{{ formatter }}" />
</van-popup> -->
		<!-- 状态 -->
		<van-popup :show="tab_list[2].show" @close="onClose" position="top">
			<view class="" :style="'padding-top:' + (navTop * 2 + 90) + 'rpx;'">
				<ul class="df ac bgcf bbf1">
					<block v-for="(item, index) in tab_list" :key="index">
						<li class="df ac jc h44 w50" @tap.native="ontabSel($event, { i: index })" :data-i="index"
							style="width: 250rpx;">
							<P :class="'f14 ' + (item.show ? 'c10' : 'c6b')" class="tabListName">{{ item.name }}</P>
							<van-icon
								:custom-style="item.show ? 'transform:rotate(-90deg);margin-left:10rpx;transition: all 0.2s;': 'transform:rotate(90deg);margin-left:10rpx;transition: all 0.2s;'"
								name="play" size="24rpx" :color="item.show ? '#1050c7' : '#6b758c'" />
						</li>
					</block>
				</ul>
				<scroll-view class="h360" :scroll-y="true">
					<ul class="db">
						<block v-for="(item, index) in status_arr" :key="index">
							<li class="pd015 h48 df ac sb" @tap.native="onTabs($event, { name: item, id: index })"
								:data-name="item" :data-id="index">
								<p :class="'f14 c28 ' + (tab_list[2].act === index ? 'c10' : '')">{{ item }}</p>
								<image class="sel" src="https://wx.xtwaixie.com/img/sel.png"
									v-if="tab_list[2].act === item.id" />
							</li>
						</block>
					</ul>
				</scroll-view>
			</view>
		</van-popup>
		<tabbar></tabbar>
		<!-- https://cdn.xtwaixie.com/uploads/20231218/1702881133657fe76dac093免费领取.png -->
		<van-popup :show="showPopup" z-index='10000' :close-on-click-overlay='grade == 0 ? false : true'
			:safe-area-inset-bottom="grade == 0 ? true : false" :position="grade == 0 ?  'center' : 'bottom'"
			custom-style='background:rgba(0,0,0,0);'>
			<view class="popupBox">
				<!-- @click="goAdd()" -->
				<!-- getImgSrc(popupImg) -->
				<image referrerPolicy='no-referrer' @click="goAdd()" :src="getImgSrc(popupImg)" mode="widthFix"
					class="popupImg" show-menu-by-longpress="true" :style="grade == 0 ? '' : 'width: 100%;'"></image>
				<image src="https://wx.xtwaixie.com/img/bh.png" v-if="grade == 0" class="popupOut"
					@click="showPopup = false"></image>
			</view>
		</van-popup>
		<!-- showCenter -->
		<van-popup :show="showCenter" z-index='10000' :close-on-click-overlay='true'
			custom-style='background:rgba(0,0,0,0);' :safe-area-inset-bottom="false" position='bottom'
			@close='showCenter = false'>
			<view class="popupBox">
				<image referrerPolicy='no-referrer'  @click="goAdd()" :src="getImgSrc(popupImg)"
						mode="widthFix" class="popupImg" show-menu-by-longpress="true" style="width: 750rpx;"></image>
			<!-- 	<image referrerPolicy='no-referrer' :src="getImgSrc('/uploads/20240930/172768083866fa51460cfb7.png')"
					mode="widthFix" class="popupImg" show-menu-by-longpress="true" style="width: 750rpx;"></image> -->
			</view>
		</van-popup>
		<van-popup :show="showWechat" z-index='10000' :close-on-click-overlay='false'
			custom-style='background:rgba(0,0,0,0);'>
			<view class="popupBox">
				<image referrerPolicy='no-referrer' :src="getImgSrc(order_qr_code)" :show-menu-by-longpress="true"
					mode="widthFix" class="popupImg"></image>
				<image src="https://wx.xtwaixie.com/img/bh.png" class="popupOut" @click="showWechat = false"></image>
			</view>
		</van-popup>
		<van-popup :show="loginPopup" z-index='10000' :close-on-click-overlay='true'
			custom-style='background:rgba(0,0,0,0);' @close='popupClose'>
			<view class="popupBox">
				<view class="loginPopup">
					<view class=""> 已筛选，请登录后查看 </view>
					<view class="df ac sb">
						<view class="" @click="popupClose"> 取消 </view>
						<view class="" @click="goLogin"> 登录 </view>
					</view>
				</view>
			</view>
		</van-popup>

		<!-- showSupplement -->
		<van-popup :show="showSupplement" round @close="showSupplement = false">
			<p class="df ac jc pd200 mt5 w311">
				<span class="f14 c28 f500">会员企业需补充资料，补充后即可正常使用</span>
			</p>
			<p class='df ac jc btf1 f16 c10 h48' @tap="goPages('/pages/Factoryinformation/Factoryinformation')">点击补充</p>
		</van-popup>

		<model :value='showTips' title='提示' content="恭喜您已获取3次免费接单机会" :showdisagreeBtn='false' agreeBtn='确认'
			@change='changeTips()' @agree='confirmSale' color='#1A4FBF' />
		<van-popup :show="firstPopup" custom-style='background:#00000000;'>
			<image src="https://cdn.xtwaixie.com/uploads/20240108/1704702779659bb33b1136b.png" mode="widthFix"
				style="width: 450rpx;padding-bottom: 800rpx;"></image>
		</van-popup>
		<view class="kfs-boximg" @click="buttonimg">
			<image style="width:" class="kfsimg"
				src="https://cdn.xtwaixie.com/uploads/20240925/172725217366f3c6cd3fefc.png"></image>
		</view>
		<view class="yyimha">
			<van-dialog style="background: none;top:50% !important;" use-slot :show="showts" @close="showts=false"
				:close-on-click-overlay="true" @getuserinfo="getuserInfo" :showConfirmButton="false"
				:showCancelButton="false">
				<image style="height: 740rpx;" show-menu-by-longpress="true"
					src="https://cdn.xtwaixie.com/uploads/20240925/172725190766f3c5c34019e.png" mode=""></image>
			</van-dialog>
		</view>
	</view>
</template>
<script>
	import {
		verifyPhoneNumber
	} from "@/utils/util"
	import tabbar from '@/component/tabbar/tabbar';
	import areaList from '../../utils/area';
	import util from '../../utils/util';
	import model from '@/component/model';
	import http from '../../utils/http';
	import popup from '@/component/new-popUp.vue'
	
		import addTips from '@/component/addTips';
	// var QQMapWX = require('../../utils/qqmap-wx-jssdk.js');
	const app = getApp();
	export default {
		components: {
			tabbar,
			model,
			popup,
			addTips
		},
		data() {
			return {
				showSupplement: false,
				cur_label: -1,
				is_expire: false,
				showts: false,
				settledStatus: '',
				is_info: null,
				searchValue: '',
				is_infos: '',
				tabChoosed: 0,
				loginPopup: false,
				showWechat: false,
				shuiyin: this.shuiyin,
				navTop: '',
				qqMapWX: '',
				show: false,
				areaList: areaList.areaList,
				showTips: false,
				tab_list: [{
						show: false,
						is_select: false,
						name: '工艺',
						act: ''
					},
					{
						show: false,
						is_select: false,
						name: '地区',
						act: ''
					},
					{
						show: false,
						is_select: false,
						name: '状态',
						act: ''
					}
				],
				label_list: [{
						name: '只看免费',
						is_select: false
					},
					{
						name: '有预付',
						is_select: false
					},
					{
						name: '来料加工',
						is_select: false
					},
					{
						name: '本地订单',
						is_select: false
					},
					{
						name: '有目标价',
						is_select: false
					}
				],
				status_arr: ['所有订单', '报价中', '已结束'],
				regular_tag: "",
				info: {
					machiningre: []
				},
				act: '',
				list: [],
				pageTotal: '',
				order_qr_code: '',
				page: 1,
				pageSize: 10,
				grade: 0,
				user_info: null,
				top_area: [],
				showPopup: false,
				showCenter: false,
				province_list: [],
				city_list: [],
				region: [{
					name: '',
					act: ''
				}, {
					name: '',
					act: ''
				}, {
					name: '',
					act: ''
				}],
				is_lookAfter: false,
				number_receive: false,
				demand_banner: [],
				currentDate: new Date().getTime(),
				minDate: new Date(2000, 1, 1).getTime(),
				remark: {},
				popupImg: '',
				firstPopup: false,
				formatter(type, value) {
					if (type === 'year') {
						return `${value}年`;
					}
					if (type === 'month') {
						return `${value}月`;
					}
					return value;
				},
				local: '',
				look_text: '',
				btn_text: '',
			};
		},
		/**
		 * 生命周期函数--监听页面加载
		 */
		onLoad(options) {
			if (options.status) {
				uni.removeStorageSync('demandZero1');
			}
			if (options.empower) {
				http.request('demand/empowerClick', {
					id: options.empower
				})
			}
			this.setData({
				navTop: app.globalData.navTop
			});
			// this.qqMapWX = new QQMapWX({
			// 	key: "XUDBZ-3OVAL-KWEPB-MXU6W-KW4XK-6WBHF",
			// });
			// this.getUserInfo()
			this.getBase();
			this.getArea(1);

			// this.getLocation();
			this.getList();
		},
		/**
		 * 生命周期函数--监听页面初次渲染完成
		 */
		onReady() {},
		/**
		 * 生命周期函数--监听页面显示
		 */
		onShow() {
			this.checkExpire()
			// this.userInfo()
			const token = uni.getStorageSync('token')
			if (token) {
				this.wxAuthLogin();
				this.getUserInfo()
			} else {
				this.label_list = [{
						name: '有预付',
						is_select: false
					},
					{
						name: '来料加工',
						is_select: false
					},
					{
						name: '本地订单',
						is_select: false
					},
					{
						name: '有目标价',
						is_select: false
					}
				]
			}
			let is_login = uni.getStorageSync('is_login');
			if (is_login) {
				this.loginPopup = false
			}

			if (token && this.page == 1) {
				this.look_text = ''
				this.btn_text = ''
				this.is_lookAfter = false
			}
			this.is_infos = uni.getStorageSync('is_info')
		},
		/**
		 * 生命周期函数--监听页面隐藏
		 */
		onHide() {},
		/**
		 * 生命周期函数--监听页面卸载
		 */
		onUnload() {},
		/**
		 * 页面相关事件处理函数--监听用户下拉动作
		 */
		onPullDownRefresh() {},
		/**
		 * 页面上拉触底事件的处理函数
		 */
		onReachBottom() {
			if (this.page < this.pageTotal) {
				if (!uni.getStorageSync('token') && this.page == 1) {
					this.is_lookAfter = true
					this.look_text = '登录后可查看更多订单'
					this.btn_text = '登录'
					return
				}
				if (this.user_info && this.user_info.grade == 0 && this.page == 3) {
					this.is_lookAfter = true
					this.look_text = '非注册供应商仅展示30条订单信息，注册后展示更多'
					this.btn_text = '免费注册'
					return
				}
				this.page++
				// console.log(this.page, this.pageTotal)
				this.getList()
			} else {
				uni.showToast({
					title: '没有更多了~',
					icon: 'none'
				});
			}
		},
		/**
		 * 用户点击右上角分享
		 */
		onShareAppMessage() {},
		methods: {
			checkExpire() {
				const currentDate = new Date().toLocaleDateString();
				const expireFlag = uni.getStorageSync('expireFlag') || {
					currentDate: '',
					show_popup: true
				};

				if (expireFlag.currentDate !== currentDate) {
					expireFlag.currentDate = currentDate;
					expireFlag.show_popup = true;
					uni.setStorageSync('expireFlag', expireFlag);
				} else {
					expireFlag.show_popup = false;
				}
				this.is_expire = expireFlag.show_popup;
				console.log(this.is_expire)
			},
			hideExpire() {
				this.is_expire = false
				const expire_flag = {
					currentDate: new Date().toLocaleDateString(),
					show_popup: false
				}
				uni.setStorageSync('expireFlag', expire_flag)
			},
			getuserInfo(event) {
				console.log(event.detail);
			},
			goSearch() {
				console.log(1)
				this.page = 1
				this.list = []
				this.getList()
				http.request('demand/getIp', {
					type: 8,
					id: 0,
					text: this.searchValue
				}).then(res => {})
			},
			changVal(e) {
				this.searchValue = e.detail
				// console.log(e)
			},
			changeLab(index) {
				uni.pageScrollTo({
					scrollTop: 0,
					duration: 0
				})
				let list = []
				if (this.cur_label === index) {
					list = []
					this.cur_label = -1
					this.label_list.map(item => item.is_select = false)
				} else {
					this.cur_label = index
					this.label_list.map((item, idx) => {
						item.is_select = false
						if (idx === index) {
							item.is_select = true
							list.push(item.name)
						}
					})
				}
				// this.regular_tag  = list.join(',') 
				this.regular_tag = list
				this.page = 1
				this.list = []
				this.getList()
			},
			// onClose() {
			// 	this.setData({
			// 		showts: false
			// 	});
			// },
			buttonimg() {
				// const token = uni.getStorageSync('token')
				// if(!token){
				// 	uni.navigateTo({
				// 		url:'/pages/login/login?pages=demand'
				// 	})
				// }
				this.showts = true
				this.setData({
					showts: true
				});
				console.log(1, this.showts);
			},
			userInfo() {
				const token = uni.getStorageSync('token')
				if (!token) {
					return
				}
				http.request('user/userInfo').then((res) => {
					this.settledStatus = res.data.userInfo.settledStatus
					this.is_infos = res.data.is_info
					this.is_info = res.data.is_info
					// this.user_info = res.data.userInfo
					console.log(this.is_info)
					console.log(res.data.userInfo.settledStatus)
				}).catch((res) => {})
			},
			demandDetails(id,view_type) {
				let first = uni.getStorageSync("firstPopup")
				if (!first) {
					this.firstPopup = true
					uni.setStorageSync('firstPopup', true)
				}
				let popupTime = uni.getStorageSync('popupTime');
				if (popupTime) {
					let nowDate = new Date().setHours(0, 0, 0, 0)
					if (nowDate > popupTime) {
						let that = this
						uni.requestSubscribeMessage({
							tmplIds: ['Ps_TGNHTlkFPLHybskEltaWoAvSZ1GhsoXfiJBGwTjA'],
							success(res) {
								if (res.Ps_TGNHTlkFPLHybskEltaWoAvSZ1GhsoXfiJBGwTjA == 'accept') {
									http.request('demand/empower')
									uni.setStorageSync('popupTime', new Date().getTime())
								}
								that.firstPopup = false
								uni.setStorageSync('firstPopup', false)
								uni.navigateTo({
									url: '/pages/demand/demandDetails?id=' + id
								})
							},
						fail(err) {
							// if (res.Ps_TGNHTlkFPLHybskEltaWoAvSZ1GhsoXfiJBGwTjA == 'accept') {
							// 	http.request('demand/empower')
							// 	uni.setStorageSync('popupTime', new Date().getTime())
							// }
							that.showTips = false
							that.firstPopup = false
							uni.setStorageSync('firstPopup', false)
							uni.navigateTo({
								url: '/pages/demand/demandDetails?id=' + id
							})
						}
						})
					} else {
						let that = this
						that.firstPopup = false
						that.firstPopup = false
						uni.setStorageSync('firstPopup', false)
						uni.navigateTo({
							url: '/pages/demand/demandDetails?id=' + id
						})
					}
				} else {
					let that = this
					uni.requestSubscribeMessage({
						tmplIds: ['Ps_TGNHTlkFPLHybskEltaWoAvSZ1GhsoXfiJBGwTjA'],
						success(res) {
							if (res.Ps_TGNHTlkFPLHybskEltaWoAvSZ1GhsoXfiJBGwTjA == 'accept') {
								http.request('demand/empower')
								uni.setStorageSync('popupTime', new Date().getTime())
							}
							that.firstPopup = false
							that.firstPopup = false
							uni.setStorageSync('firstPopup', false)
							uni.navigateTo({
								url: '/pages/demand/demandDetails?id=' + id
							})
						},
						fail(err) {
							// if (res.Ps_TGNHTlkFPLHybskEltaWoAvSZ1GhsoXfiJBGwTjA == 'accept') {
							// 	http.request('demand/empower')
							// 	uni.setStorageSync('popupTime', new Date().getTime())
							// }
							that.showTips = false
							that.firstPopup = false
							uni.setStorageSync('firstPopup', false)
							uni.navigateTo({
								url: '/pages/demand/demandDetails?id=' + id
							})
						}
					})
				}
			},
			goLogin() {
				uni.navigateTo({
					url: "/pages/login/login"
				})
			},
			changeTab(index, id, name) {
				// if(this.tabChoosed == index) return
				this.tabChoosed = index
				// this.onTab(id,name)
				let act = this.act;
				console.log(name, id);
				this.setData({
					[`tab_list[${act}].name`]: name == '全部' ? '工艺' : name,
					[`tab_list[${act}].act`]: id,
					list: [],
					page: 1
				});
				this.getList();
				this.onClose();
				this.getIp(name)
				this.setData({
					[`tab_list[${act}].is_select`]: name !== '全部' && this.tab_list[act].name != ''
				})
			},
			getIp(name) {
				http.request('demand/getIp', {
					type: 9,
					id: 0,
					text: name
				}).then(res => {})
			},
			popupClose() {
				this.loginPopup = false
				this.regular_tag = []
				this.cur_label = -1
				this.label_list.map(item => item.is_select = false)
				this.list = []
				this.tab_list[0].act = ''
				this.region[0].name = ''
				this.region[1].name = ''
				this.tab_list[2].act = ''
				this.searchValue = ''
				this.tab_list = [{
						show: false,
						is_select: false,
						name: '工艺',
						act: ''
					},
					{
						show: false,
						is_select: false,
						name: '地区',
						act: ''
					},
					{
						show: false,
						is_select: false,
						name: '状态',
						act: ''
					}
				]
				this.region = [{
					name: '',
					act: ''
				}, {
					name: '',
					act: ''
				}, {
					name: '',
					act: ''
				}]
				this.getList()
			},
			changeTips() {
				this.showTips = false
			},
			confirmSale() {
				this.showTips = false
			},
			goPages(url) {
				const token = uni.getStorageSync('token');
				if (!token && url === '/pages/settled/setPage') {
					uni.navigateTo({
						url: '/pages/login/login?pages=setPage'
					})
					return
				}
				uni.navigateTo({
					url: url
				})
			},
			goAdd() {
				this.showPopup = false
				if (this.grade === 0) {
					if (this.remark.settle_in) {
						let that = this
						uni.navigateTo({
							url: that.remark.settle_in,
							fail: function(res) {
								uni.switchTab({
									url: that.remark.settle_in
								})
							}
						})
					} else {
						uni.navigateTo({
							url: '/pages/settled/setPage',
							fail: function(res) {
								uni.switchTab({
									url: '/pages/settled/setPage'
								})
							}
						})
					}
				} else {
					let first = uni.getStorageSync("firstPopup")
					if (!first) {
						this.firstPopup = true
						uni.setStorageSync('firstPopup', true)
					}
					let popupTime = uni.getStorageSync('popupTime');
					if (popupTime) {
						let nowDate = new Date().setHours(0, 0, 0, 0)
						if (nowDate > popupTime) {
							let that = this
							uni.requestSubscribeMessage({
								tmplIds: ['Ps_TGNHTlkFPLHybskEltaWoAvSZ1GhsoXfiJBGwTjA'],
								success(res) {
									if (res.Ps_TGNHTlkFPLHybskEltaWoAvSZ1GhsoXfiJBGwTjA == 'accept') {
										http.request('demand/empower')
										uni.setStorageSync('popupTime', new Date().getTime())
									}
									that.firstPopup = false
									http.request('user/receive', {}).then((res) => {
										that.showCenter = false
										that.showTips = true
										setTimeout(() => {
											that.showTips = false
										}, 2000);
									}).catch((res) => {
										uni.showToast({
											title: res.message,
											icon: 'none'
										});
									});
								},
								fail(err){
									// if (res.Ps_TGNHTlkFPLHybskEltaWoAvSZ1GhsoXfiJBGwTjA == 'accept') {
									// 	http.request('demand/empower')
									// 	uni.setStorageSync('popupTime', new Date().getTime())
									// }
									that.firstPopup = false
									http.request('user/receive', {}).then((res) => {
										that.showCenter = false
										that.showTips = true
										setTimeout(() => {
											that.showTips = false
										}, 2000);
									}).catch((res) => {
										uni.showToast({
											title: res.message,
											icon: 'none'
										});
									});
								}
							})
							
						} else {
							let that = this
							that.firstPopup = false
							http.request('user/receive', {}).then((res) => {
								that.showCenter = false
								that.showTips = true
								setTimeout(() => {
									that.showTips = false
								}, 2000);
							}).catch((res) => {
								uni.showToast({
									title: res.message,
									icon: 'none'
								});
							});
						}
					} else {
						let that = this
						uni.requestSubscribeMessage({
							tmplIds: ['Ps_TGNHTlkFPLHybskEltaWoAvSZ1GhsoXfiJBGwTjA'],
							success(res) {
								if (res.Ps_TGNHTlkFPLHybskEltaWoAvSZ1GhsoXfiJBGwTjA == 'accept') {
									http.request('demand/empower')
									uni.setStorageSync('popupTime', new Date().getTime())
								}
								that.firstPopup = false
								http.request('user/receive', {}).then((res) => {
									that.showCenter = false
									that.showTips = true
									setTimeout(() => {
										that.showTips = false
									}, 2000);
								}).catch((res) => {
									uni.showToast({
										title: res.message,
										icon: 'none'
									});
								});
							},
							fail(err){
								// if (res.Ps_TGNHTlkFPLHybskEltaWoAvSZ1GhsoXfiJBGwTjA == 'accept') {
								// 	http.request('demand/empower')
								// 	uni.setStorageSync('popupTime', new Date().getTime())
								// }
								that.firstPopup = false
								http.request('user/receive', {}).then((res) => {
									that.showCenter = false
									that.showTips = true
									setTimeout(() => {
										that.showTips = false
									}, 2000);
								}).catch((res) => {
									uni.showToast({
										title: res.message,
										icon: 'none'
									});
								});
							}
						})
					}
				}
			},
			getUserInfo(status = false) {
				const token = uni.getStorageSync('token')
				if (!token) {
					return
				}
				http.request('user/userInfo').then((res) => {
					if (status) {
						this.showTips = true
						setTimeout(() => {
							this.showTips = false
						}, 2000);
					}
					this.is_info = res.data.is_info
					console.log(this.is_info)
					this.user_info = res.data.userInfo

					if (this.user_info.mobile && this.user_info.grade == 2 && !this.user_info.settledInfoStatus) {
						this.showSupplement = true
					}

					this.grade = res.data.userInfo.grade
					
					console.log(this.grade,'grade')

					if (this.grade != 0) {
						http.request('user/settledInfo').then(rest => {
							this.local = rest.data.info.province
						})
					} else {
						this.label_list = [{
								name: '有预付',
								is_select: false
							}, {
								name: '来料加工',
								is_select: false
							},
							{
								name: '本地订单',
								is_select: false
							},
							{
								name: '有目标价',
								is_select: false
							}
						]
					}

					if (res.data.userInfo.grade === 0 || (res.data.userInfo.grade === 1 && !res.data.userInfo
							.number_receive)) {
						this.getBases(res.data.userInfo.grade)
					}
				}).catch((res) => {
					uni.showToast({
						title: res.message,
						icon: 'none'
					});
				});
			},
			getBases(index, isReceive) {
				http.request('base/configData').then((res) => {
					this.remark = res.data.remark
					if (index === 0) {
						this.popupImg = res.data.settle_in
					} else {
						this.popupImg = res.data.personal_center
					}
					let demandZero = uni.getStorageSync('demandZero' + index);
					if (demandZero) {
						let nowDate = new Date().setHours(0, 0, 0, 0)
						if (nowDate > demandZero) {
							uni.setStorageSync('demandZero' + index, new Date().getTime())
							// if (index === 0) {
							// 	this.showPopup = true
							// } else {
							// 	this.showCenter = true
							// }
							this.showCenter = true
						}
					} else {
						uni.setStorageSync('demandZero' + index, new Date().getTime())
						// if (index === 0) {
						// 	this.showPopup = true
						// } else {
						// 	this.showCenter = true
						// }
						this.showCenter = true
					}
				}).catch((res) => {
					console.log(res);
				});
			},
			// 时间确认
			onConfirm(e) {
				let time = util.formatTime(e.detail, 'YYYY-MM-DD');
				this.setData({
					page: 1,
					list: [],
					[`tab_list[2].name`]: time
				});
				this.onClose();
				console.log(this.tab_list[2].name);
				this.getList();
			},
			// 确认省市择
			onRegion(e, _dataset) {
				/* ---处理dataset begin--- */
				this.handleDataset(e, _dataset);
				/* ---处理dataset end--- */
				let name = e.currentTarget.dataset.name;
				let id = e.currentTarget.dataset.id;
				let type = e.currentTarget.dataset.type;
				this.setData({
					[`region[${type}].name`]: name,
					[`region[${type}].act`]: id
				});
				if (type == 0) {
					this.getArea(id);
				} else if (type == 1) {
					this.setData({
						page: 1,
						list: [],
						[`tab_list[1].name`]: name
					});
					this.onClose();
					this.getList();
					this.getIp(name)
					this.setData({
						[`tab_list[${type}].is_select`]: this.region[type].act != ''
					});
				}
			},
			// 获取列表
			getList() {
				let data = {
					page: this.page,
					pageSize: this.pageSize,
					machining_id: this.tab_list[0].act || '',
					// material_id: this.data.tab_list[1].act || "",
					province: this.region[0].name,
					city: this.region[1].name,
					// created_at:
					//   this.data.tab_list[2].name == "日期" ? "" : this.data.tab_list[2].name,
					status: this.tab_list[2].act || '',
					regular_tag: this.regular_tag,
					key: this.searchValue,
					local: this.local
				};
				if (this.tab_list[0].name != '全部' && this.tab_list[0].act != 0) {
					data.machining_type = 1
				}
				http.request('demand/demandList', data).then((res) => {
					res.data.list.forEach((i) => {
						if (i.custom_tag == "") {
							i.custom_tag = []
						} else {
							i.custom_tag = i.custom_tag.split(',');
						}
						if(!i?.parts_piece){
							i.parts_piece='件'
						}
						this.list.push(i)
					});

					this.setData({
						pageTotal: res.data.pageTotal,
						list: res.data.list.length == 0 ? [] : this.list
					});
					this.number_receive = res.data.number_receive
					const has_regular_tag = this.regular_tag != '' && this.regular_tag.length != 0

					if (this.tab_list[0].act != '' || this.region[0].name != '' || this.region[1].name != '' ||
						this.tab_list[2].act != '' || has_regular_tag || this.searchValue != '') {
						this.loginPopup = verifyPhoneNumber(false)
						
						// let is_login = uni.getStorageSync('is_login');
						// if (!is_login) {
						// 	this.loginPopup = true
						// }
					}
				}).catch((res) => {
					uni.showToast({
						title: res.message,
						icon: 'none'
					});
				});
			},
			// 选择
			ontabSel(e, _dataset) {
				/* ---处理dataset begin--- */
				this.handleDataset(e, _dataset);
				/* ---处理dataset end--- */
				let i = e.currentTarget.dataset.i;
				let status = this.tab_list[i].show;

				this.tab_list.map(item => item.show = false)
				this.setData({
					[`tab_list[${i}].show`]: !status,
					act: i
				});

			},
			onTab(e, _dataset) {
				/* ---处理dataset begin--- */
				this.handleDataset(e, _dataset);
				/* ---处理dataset end--- */
				let name = e.currentTarget.dataset.name;
				let id = e.currentTarget.dataset.id;
				let act = this.act;
				console.log(name, id);
				this.setData({
					[`tab_list[${act}].name`]: name,
					[`tab_list[${act}].act`]: id,
					list: [],
					page: 1
				});
				this.getList();
				this.onClose();
			},
			onTabs(e, _dataset) {
				/* ---处理dataset begin--- */
				this.handleDataset(e, _dataset);
				/* ---处理dataset end--- */
				let name = e.currentTarget.dataset.name;
				let id = e.currentTarget.dataset.id;
				let act = this.act;
				this.setData({
					[`tab_list[${act}].name`]: name,
					[`tab_list[${act}].act`]: id,
					list: [],
					page: 1
				});
				this.getList();
				this.onClose();
				this.getIp(name)
				this.setData({
					[`tab_list[${act}].is_select`]: this.tab_list[act].act != '',
				});
			},
			// 关闭
			onClose() {
				this.setData({
					show: false,
					[`tab_list[0].show`]: false,
					[`tab_list[1].show`]: false,
					[`tab_list[2].show`]: false
				});
			},
			showPopups() {
				this.setData({
					show: true
				});
			},
			// 获取配置
			getBase() {
				http.request('base/configData').then((res) => {
					res.data.machiningre = [{
						id: 0,
						name: '全部',
						children: []
					}].concat(res.data.machining)
					res.data.machiningre.forEach(item => {
						item.children.unshift({
							name: "全部",
							id: item.id,
							machining_type: 0
						})
					})
					this.setData({
						info: res.data,
						demand_banner: res.data.new_demand_banner
					});
					this.popupImg = res.data.personal_center
					this.order_qr_code = res.data.order_qr_code
					uni.setStorageSync('gz_img', res.data.official_accounts);
				}).catch((res) => {
					uni.showToast({
						title: res.message,
						icon: 'none'
					});
				});
			},
			onSwiper(e) {
				let item = e.currentTarget.dataset.item;
				if(item.url_type==12){
					uni.navigateTo({
						url: '/subPack/factoryDetails/factoryDetails?id='+item.goods_id
					});
					return
				}
				if (item.url == '/pages/landing/landing') {
					uni.navigateTo({
						url: '/pages/landing/landing'
					});
					return
				}
				if (item.url_type === 6) {
					uni.navigateTo({
						url: '/pages/recharge/recharge'
					});
					// if (uni.getSystemInfoSync().platform === 'ios') {
					// 	uni.navigateTo({
					// 		url: '/pages/recharge/iosvip'
					// 	});
					// } else {
					// 	uni.navigateTo({
					// 		url: '/pages/recharge/recharge'
					// 	});
					// }
					return
				}
				switch (item.url_type) {
					case 1:
						uni.redirectTo({
							url: '/pages/demand/subDemand'
						});
						break;
					case 2:
						uni.navigateTo({
							url: '/pages/order/shopDetail?id=' + item.goods_id
						});
						break;
					case 3:
						uni.redirectTo({
							url: '/pages/shopping/shopping'
						});
						break;
					case 4:
						uni.navigateTo({
							url: '/pages/content/content?id=' + item.id
						});
						break;
					case 5:
						uni.navigateTo({
							url: '/pages/settled/setPage'
						});
						break;
					case 7:
						uni.navigateTo({
							url: '/subPack/out/out?url=' + item.url
						});
						break;
					case 8:
						uni.navigateTo({
							url: '/pages/demand/demand'
						});
						break;
					case 9:
						uni.navigateTo({
							url: '/pages/myQuotation/myQuotation'
						});
						break;
					case 10:
						uni.navigateTo({
							url: '/pages/myInquiry/myInquiry'
						});
						break;
					case 11:
						uni.redirectTo({
							url: '/pages/shopping/shopping'
						});
						break;
				}
			},
			getArea(id) {
				let data = {
					pid: id
				};
				http.request('base/region', data).then((res) => {
					if (id === 1) {
						this.setData({
							province_list: res.data
						});
					} else {
						this.setData({
							city_list: res.data
						});
					}
				}).catch((res) => {
					uni.showToast({
						title: res.message,
						icon: 'none'
					});
				});
			},
			// 获取定位地址
			// getLocation() {
			// 	return new Promise((resolve, reject) => {
			// 		let that = this;
			// 		uni.getLocation({
			// 			success(res) {
			// 				let latitude = res.latitude;
			// 				let longitude = res.longitude;
			// 				that.qqMapWX.reverseGeocoder({
			// 					location: {
			// 						latitude: latitude,
			// 						longitude: longitude
			// 					},
			// 					success(res) {
			// 						let val = res.result.address_component.city;
			// 						let val1 = res.result.address_component.province;
			// 						that.setData({
			// 							top_area: [val1, val]
			// 						});
			// 						uni.setStorageSync('top_area', that.top_area);
			// 					},
			// 					fail(err) {
			// 						console.debug(err);
			// 					}
			// 				});
			// 			},
			// 			fail(err) {
			// 				reject(err);
			// 			}
			// 		});
			// 	});
			// },
			//  顶部地址选择
			confirm(e) {
				this.setData({
					[`top_area[0]`]: e.detail.values[0].name,
					[`top_area[1]`]: e.detail.values[1].name
				});
				this.onClose();
			},
			goWeb() {
				uni.navigateTo({
					url: '/pages/webview/webview'
				});
			},
			wxAuthLogin() {
				let that = this;
				uni.login({
					complete: (res) => {
						let data = {
							code: res.code
						};
						let h = {
							'content-type': 'application/x-www-form-urlencoded'
						};

						uni.request({
							url: http.appUrl + 'login/getLogin',
							data: data,
							method: 'POST',
							header: h,
							success: (res) => {
								uni.setStorageSync('token', res.data.data.token.token);
								uni.setStorageSync('is_login', res.data.code);
							},
							fail(res) {
								console.log(res);
							}
						});
					}
				});
			}
		}
	};
</script>
<style lang="scss">
	@import './demand.css';

	.kfs-boximg {
		position: fixed;
		right: 64rpx;
		bottom: 170rpx;
		width: 88rpx;
		height: 88rpx;
		z-index: 9999;
		width: 88rpx !important;
		height: 88rpx;
		padding: 0;
		margin: 0 !important;
	}

	.kfsimg {
		width: 108rpx;
		height: 108rpx;
		position: relative;
		z-index: 9;
		margin-right: 30rpx;
	}

	.yyimha {

		.van-popup {
			background: none !important;
		}

		.van-dialog {
			background: none !important;
			top: 50% !important;
			// transform: translateY(-50%);
		}


	}

	.tabListName {
		overflow: hidden;
		/*   超出容器的部分影响  */
		white-space: nowrap;
		/*  文本不换行   */
		text-overflow: ellipsis;
		/*  超出容器的文本显示省略号  */
	}

	.popupBox {
		display: flex;
		flex-direction: column;
		align-items: center;
	}

	.popupImg {
		width: 550rpx;
	}

	.popupOut {
		width: 50rpx;
		height: 50rpx;
		margin-top: 100rpx;
	}

	.loginPopup {
		width: 550rpx;
		height: 200rpx;
		background-color: #FFF;
		border-radius: 20rpx;
		display: flex;
		flex-direction: column;
		justify-content: space-evenly;
		align-items: center;
	}

	.loginPopup>view:first-child {
		color: #000;
		font-size: 28rpx;
		font-weight: bold;
	}

	.loginPopup>view:first-child {
		color: #000;
		font-size: 28rpx;
		font-weight: bold;
	}

	.loginPopup>view:last-child {
		width: 75%;
	}

	.loginPopup>view:last-child>view:last-child {
		font-size: 30rpx;
		border-radius: 12rpx;
		font-weight: bold;
		color: #FFF;
		padding: 15rpx 65rpx;
		background-color: #01C060;
	}

	.loginPopup>view:last-child>view:first-child {
		font-size: 30rpx;
		border-radius: 12rpx;
		font-weight: bold;
		// color: #FFF;
		padding: 15rpx 65rpx;
		background-color: #D6D6D6;
	}
</style>